From 8e3bc2f9ef96811cdb421e6397060e3d1f0c015b Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Tue, 8 Oct 2024 15:34:03 -0700
Subject: feat(graphql): add badgeCount field

---
 src/routes/user/[user]/+page.svelte | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/routes/user/[user]/+page.svelte')

diff --git a/src/routes/user/[user]/+page.svelte b/src/routes/user/[user]/+page.svelte
index 03e13f11..84f121ea 100644
--- a/src/routes/user/[user]/+page.svelte
+++ b/src/routes/user/[user]/+page.svelte
@@ -307,8 +307,8 @@
 
 						{#if $Profile.fetching}
 							{displayBadges(userData.name, '...')}
-						{:else if $Profile.data}
-							{@const badges = $Profile.data.User.badges.length}
+						{:else if $Profile.data && $Profile.data.User}
+							{@const badges = $Profile.data.User.badgesCount}
 
 							{#if badges}
 								{displayBadges(userData.name, badges)}
-- 
cgit v1.2.3

